uniform sampler2D		position, normal;
uniform sampler2D		albedo;

const vec3 light_position = vec3(20, 100, 0);

void main()
{
	vec2 texCoord = gl_TexCoord[0].st;
	
	vec3 p = texture2D(position, texCoord).xyz;
	vec3 N = normalize(texture2D(normal, texCoord).xyz);
	
	
	vec3 L = normalize(light_position - p);
	float lambert = max(0.0, dot(N, L));
	
	vec3 color = texture2D(albedo, texCoord).rgb;
	color *= lambert;

	gl_FragColor = vec4(color, 1.0);
}